package com.demo.webmagic.pageProcessor;

import us.codecraft.webmagic.Page;
import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.processor.PageProcessor;

public class PageProcessorVeryZhunFlightNo implements PageProcessor{

	private Site site = Site.me().setRetryTimes(3).setSleepTime(100);
	
	@Override
	public Site getSite() {
		return site;
	}

	@Override
	public void process(Page page) {
		page.putField("fnoList", page.getHtml().xpath("//div[@id='list']/div[@class='list']/p/a/text()").all());
	}
	
	public static void main(String[] args) {
		Spider.create(new PageProcessorVeryZhunFlightNo()).addUrl("http://www.veryzhun.com/planenumber.html").start();
	}

}
